﻿@model Guid?
           
@{
    Guid? editorSource = Guid.Empty;
    if (Model.HasValue)
    {
        editorSource = Model;
    }
    bool RenderEmptyWhenZero = (ViewBag.RenderEmptyWhenZero != null && ViewBag.RenderEmptyWhenZero ? true : false);
}

@Html.TextBox("", (RenderEmptyWhenZero && editorSource == Guid.Empty ? "" : editorSource.ToString()), 
                                        new {
                                                @class = "numeric" + ((ViewBag.Required != null && ViewBag.Required) ? " Required" : ""),
                                                style = "width: " + (ViewBag.Width != null ? ViewBag.Width : "60") + "px"
                                            })
